<?php namespace Admin\Controller;
use Hdphp\Controller\Controller;
//网站配置控制器
class WebSetController extends CommonController{
	public function index(){
		$model = new \Admin\Model\WebSet;
		if(IS_POST){
			foreach (Q('post.') as $k =>$v) {
				
				$model->where("name='{$k}'")->save(array('value'=>$v));
			}
//			p(Q('post.'));exit;
			file_put_contents('./Config/webset.php',"<?php return " . var_export(Q('post.'),TRUE) . ";?>");
			View::success('更改成功');
		}
		$data = $model->get();
		
		View::with('data',$data);
	    View::make();
	}
}



 ?>